?><?
class cls_personal_message extends cls_discussion{


  function get($user,$page=0){return parent::get_db_items(cls_discussion::entity(),array(array(otEMP,"entity_name",otEQ,"user"),array(otAND,"entity_id",otEQ,$user->id),array(otAND,"discussion_archived_sent",otEQ,0)),array("discussion_created"=>"desc"));}
  function get_incoming($user,$page=0){return parent::get_db_items(cls_discussion::entity(),array(array(otEMP,"entity_name",otEQ,"user"),array(otAND,"entity_id",otEQ,$user->id),array(otAND,"discussion_archived_rcpt",otEQ,0)),array("discussion_created"=>"desc"));}
  function get_first($user,$page=0){return parent::get_db_items(cls_discussion::entity(),array(array(otEMP,"entity_name",otEQ,"user"),array(otAND,"entity_id",otEQ,$user->id),array(otAND,"discussion_archived_sent",otEQ,0)),array("discussion_created"=>"desc"),array(0=>1));}
  function sent($object,$page=0){return parent::get_db_items(cls_discussion::entity(),array(array(otEMP,"entity_name",otEQ,"user"),array(otAND,"creator_id",otEQ,$object->id),array(otAND,"discussion_archived_sent",otEQ,0)),array("discussion_created"=>"desc"));}
  function count_sent($object){return parent::count_db_items(cls_discussion::entity(),array(array(otEMP,"entity_name",otEQ,"user"),array(otAND,"creator_id",otEQ,$object->id),array(otAND,"discussion_archived_sent",otEQ,0)));}
}

<#Include File="personal/cls_personal_message_item.php"#>